import http from '../../http'
import type { ApiResponse } from '@/types/api'

export async function adminCreateTag(payload: { name: string; color?: string }) {
  const resp = await http.post<ApiResponse<boolean>>('/admin/tags', payload)
  return resp.data
}

export async function adminUpdateTag(id: number, payload: { name: string; color?: string }) {
  const resp = await http.put<ApiResponse<boolean>>(`/admin/tags/${id}`, payload)
  return resp.data
}

export async function adminDeleteTag(id: number) {
  const resp = await http.delete<ApiResponse<boolean>>(`/admin/tags/${id}`)
  return resp.data
}


